<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<script src="<c:url value='/js/search_valid.js'/>"></script>
<div class="page-header">
	<h3 style="margin-top: auto">用户列表</h3>
	<form class="form-search"
		action="<%=request.getContextPath()%>/user/search" method="POST"
		onsubmit="return valid();">
		<div class="input-append">
			<input type="text" class="span1 search-query" id="searchText"
				name="searchText" style="margin-left: 20px; width: 400px">
			<button type="submit" class="btn">
				<i class="icon-search"></i>&nbsp;搜索用户
			</button>
		</div>
	</form>
</div>
<div class="row-fluid">
	<div>
		<c:choose>
			<c:when test="${!empty bean}">
				<table class="table table-hover">
					<thead>
						<tr>
							<th width="10%">编号</th>
							<th width="20%">用户名</th>
							<th width="20%">真实姓名</th>
							<th width="20%">工号</th>
							<th width="30%">操作</th>
						</tr>
					</thead>
					<tbody>
					<c:forEach items="${bean}" var="list" varStatus="s">
						<tr>
							<td><c:out value="${s.count}" /></td>
							<td><c:out value="${list.username}" /></td>
							<td><c:out value="${list.realname}" /></td>
							<td><c:out value="${list.staffNum}" /></td>
							<td><button class="btn"
									onclick="window.location.href='<%=request.getContextPath()%>/user/${list.id}';"><i class="icon-search"></i>&nbsp;详细信息</button></td>
						</tr>
					</c:forEach>
					</tbody>
				</table>
			</c:when>
			<c:otherwise>
				<c:if test="${flag != 1}">
				<h3 style="margin-top: auto">数据库暂无相关用户信息</h3>
				</c:if>
			</c:otherwise>
		</c:choose>
	</div>
</div>